package com.ruoyi.web.controller.dispatch;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.DispatchTheoreticalPressureDecayValues;
import com.ruoyi.system.service.IDispatchTheoreticalPressureDecayValuesService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 压力理论衰减值Controller
 * 
 * @author ruoyi
 * @date 2025-03-02
 */
@RestController
@RequestMapping("/system/dispatchTheoreticalPressureDecayValues")
public class DispatchTheoreticalPressureDecayValuesController extends BaseController
{
    @Autowired
    private IDispatchTheoreticalPressureDecayValuesService dispatchTheoreticalPressureDecayValuesService;

    /**
     * 查询压力理论衰减值列表
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchTheoreticalPressureDecayValues:list')")
    @GetMapping("/list")
    public TableDataInfo list(DispatchTheoreticalPressureDecayValues dispatchTheoreticalPressureDecayValues)
    {
        startPage();
        List<DispatchTheoreticalPressureDecayValues> list = dispatchTheoreticalPressureDecayValuesService.selectDispatchTheoreticalPressureDecayValuesList(dispatchTheoreticalPressureDecayValues);
        return getDataTable(list);
    }

    /**
     * 导出压力理论衰减值列表
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchTheoreticalPressureDecayValues:export')")
    @Log(title = "压力理论衰减值", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DispatchTheoreticalPressureDecayValues dispatchTheoreticalPressureDecayValues)
    {
        List<DispatchTheoreticalPressureDecayValues> list = dispatchTheoreticalPressureDecayValuesService.selectDispatchTheoreticalPressureDecayValuesList(dispatchTheoreticalPressureDecayValues);
        ExcelUtil<DispatchTheoreticalPressureDecayValues> util = new ExcelUtil<DispatchTheoreticalPressureDecayValues>(DispatchTheoreticalPressureDecayValues.class);
        util.exportExcel(response, list, "压力理论衰减值数据");
    }

    /**
     * 获取压力理论衰减值详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchTheoreticalPressureDecayValues:query')")
    @GetMapping(value = "/{theoreticalPressureDecayValuesId}")
    public AjaxResult getInfo(@PathVariable("theoreticalPressureDecayValuesId") Long theoreticalPressureDecayValuesId)
    {
        return success(dispatchTheoreticalPressureDecayValuesService.selectDispatchTheoreticalPressureDecayValuesByTheoreticalPressureDecayValuesId(theoreticalPressureDecayValuesId));
    }

    /**
     * 新增压力理论衰减值
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchTheoreticalPressureDecayValues:add')")
    @Log(title = "压力理论衰减值", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DispatchTheoreticalPressureDecayValues dispatchTheoreticalPressureDecayValues)
    {
        return toAjax(dispatchTheoreticalPressureDecayValuesService.insertDispatchTheoreticalPressureDecayValues(dispatchTheoreticalPressureDecayValues));
    }

    /**
     * 修改压力理论衰减值
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchTheoreticalPressureDecayValues:edit')")
    @Log(title = "压力理论衰减值", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DispatchTheoreticalPressureDecayValues dispatchTheoreticalPressureDecayValues)
    {
        return toAjax(dispatchTheoreticalPressureDecayValuesService.updateDispatchTheoreticalPressureDecayValues(dispatchTheoreticalPressureDecayValues));
    }

    /**
     * 删除压力理论衰减值
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchTheoreticalPressureDecayValues:remove')")
    @Log(title = "压力理论衰减值", businessType = BusinessType.DELETE)
	@DeleteMapping("/{theoreticalPressureDecayValuesIds}")
    public AjaxResult remove(@PathVariable Long[] theoreticalPressureDecayValuesIds)
    {
        return toAjax(dispatchTheoreticalPressureDecayValuesService.deleteDispatchTheoreticalPressureDecayValuesByTheoreticalPressureDecayValuesIds(theoreticalPressureDecayValuesIds));
    }
}
